<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        // let arr = [1,2,3];
        // let arr2 = [];
        // for(let i=0;i<arr.length;i++){
        //     arr2.push(arr[i])
        // }
        // console.log(arr2);
        // console.log(arr===arr2);


        // 合并数组
        // let arr = [1,2,3];

        // // 返回一个新数组
        // let arr2 = arr.concat();

        // console.log(arr2);
        // console.log(arr);
        // console.log(arr===arr2);


        // 复制数组
        let arr = [1,2,3];
        let [...arr2] = arr;
        console.log(arr2);
        console.log(arr===arr2);
        

    </script>
</body>
</html>